{% extends "base.html" %}
{% block body %}
  <form class="form-inline my-2 my-lg-0">
    <input tabindex="1" class="form-control mr-sm-2" placeholder="Search" name="link" value="{{ query_link }}" aria-label="Search" type="text">
    <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
  </form>
  
  {% if paths %}
    {{ pagination.info }}
    {{ pagination.links }}
    <div class="table-responsive">
      <table class="table table-hover">
        <thead>
          <tr><th width="10">#</th><th width="10">parent</th><th>link</th></tr>
        </thead>
        <tbody>
          {% for path in paths %}
            {% set rlink = path.link.replace("{hostname}", "%s"%(hostname)) %}
            <tr>
              <td>{{ loop.index + (page - 1) * per_page }}</td>
              <td><a href="{{ dirname(rlink) }}">..</a>
              <td><a href="{{ rlink }}" target="_blank">{{ rlink }}</a></td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
    {{ pagination.links }}
  {% else %}
    <div>search result of key [{{ query_link }}] not find data</div>
  {% endif %}
{% endblock %}